package com.situ.personal.listener;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

public class MyHttpSessionAttributeListener implements HttpSessionAttributeListener{

	// 当调用session.setAttribute();这个方法会被触发
	@Override
	public void attributeAdded(HttpSessionBindingEvent se) {
		System.out.println("MyHttpSessionAttributeListener.attributeAdded()");
	}

	// 当调用session.removeAttribute();这个方法会被触发
	@Override
	public void attributeRemoved(HttpSessionBindingEvent se) {
		System.out.println("MyHttpSessionAttributeListener.attributeRemoved()");
	}

	// 当调用session.setAttribute();原来已经有，如果是覆盖的话会触发
	@Override
	public void attributeReplaced(HttpSessionBindingEvent se) {
		System.out.println("MyHttpSessionAttributeListener.attributeReplaced()");
	}

}

